import { Column, Entity, PrimaryColumn } from 'typeorm';

@Entity({ name: 'news', orderBy: { pubDate: 'DESC' } })
export class News {
  @PrimaryColumn()
  id: number;
  @Column({ length: 500, nullable: true })
  title: string;
  @Column({ type: 'bigint', nullable: true })
  createTime: number;

  // @Column({ type: 'datetime', nullable: true })
  @Column({ nullable: true, type: 'bigint' })
  pubDate: number;

  @Column({ nullable: true })
  infoSource: string; //人民日报
  @Column({ nullable: true })
  provinceId: string;
  @Column({ nullable: true, default: '' })
  provinceName: string;

  @Column({ nullable: true })
  sourceUrl: string;
  @Column({ length: 2000, nullable: true })
  summary: string;

  @Column({ type: 'datetime', nullable: true })
  sendTime: string;
}
